]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
networkAgent: Restore the NOFILE limit
authorOlivier Fourdan <ofourdan@redhat.com>
Wed, 19 Jan 2022 09:13:50 +0000 (10:13 +0100)
committerOlivier Fourdan <ofourdan@redhat.com>
Tue, 8 Feb 2022 08:25:25 +0000 (08:25 +0000)
Restore the original NOFILE limit prior to spawn the VPN helper.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2117>

js/ui/components/networkAgent.js

index 4f880a4dd5cb211a2e9d26f22cfeb41d2487e1fd..8c8d8451b81bff14f7f0203ee1814a969dd7878f 100644 (file)
@@ -389,11 +389,17 @@ var VPNRequestHandler = class {
 
         try {
             let [success_, pid, stdin, stdout, stderr] =
-                GLib.spawn_async_with_pipes(null, /* pwd */
-                                            argv,
-                                            null, /* envp */
-                                            GLib.SpawnFlags.DO_NOT_REAP_CHILD,
-                                            null /* child_setup */);
+                GLib.spawn_async_with_pipes(
+                    null, /* pwd */
+                    argv,
+                    null, /* envp */
+                    GLib.SpawnFlags.DO_NOT_REAP_CHILD,
+                    () => {
+                        try {
+                            global.context.restore_rlimit_nofile();
+                        } catch (err) {
+                        }
+                    });
 
             this._childPid = pid;
             this._stdin = new Gio.UnixOutputStream({ fd: stdin, close_fd: true });